<?php
session_start();
$name = $_SESSION['username'];
if ($name) {
 echo "<script>
  alert(\"$name ,welcome\");
</script>";
}else{
	echo "<script>
		document.write(\"dfdsfa\");
		window.location.href=\"http://www.baidu.com\";
</script>";
}

